package java_thinking.unit_16;

import java.util.Arrays;

/**
 * @Desc:   三维数组
 * @author: cww
 * @DateTime: 2019/4/9 8:28
 */

public class E07_Filling3DArray {
    public static BerylliumSphere[][][] spheres;
    public static BerylliumSphere[][][][] spheres1;
    public static BerylliumSphere[][][] fill(int xLen,int yLen,int zLen) {
        spheres = new BerylliumSphere[xLen][yLen][zLen];
        for (int i =0;i<xLen;i++) {
            for (int j =0;j<yLen;j++) {
                for (int k = 0;k<zLen;k++) {
                    spheres[i][j][k] = new BerylliumSphere();
                }
            }
        }
        return spheres;
    }
    public static BerylliumSphere[][][] fill1(int xLen,int yLen,int zLen,int tLen) {
        spheres = new BerylliumSphere[xLen][yLen][zLen];
        for (int i =0;i<xLen;i++) {
            for (int j =0;j<yLen;j++) {
                for (int k = 0;k<zLen;k++) {
                    for (int l = 0;l<tLen;l++) {

                        spheres1[i][j][k][l] = new BerylliumSphere();
                    }
                }
            }
        }
        return spheres;
    }


    public static void main(String[] args) {
        System.out.println(Arrays.deepToString(fill(2,3,4)));
        System.out.println(Arrays.deepToString(fill1(2,3,4,3)));
    }
}
